macro_rules! assert_main_thread {
  () => {
    assert!($crate::is_main_thread())
  };
}
mod color;
mod image;
mod image_view;
mod mtk_view;
mod view;
mod view_controller;

#[macro_use]
extern crate objc;

pub use color::UIColor;
pub use image::UIImage;
pub use image_view::UIImageView;
pub use mtk_view::{IMTKView, MTKView};
pub use view::{IUIView, UIView};
pub use view_controller::{IUIViewController, UIViewController};

#[link(name = "UIKit", kind = "framework")]
extern "C" {}

fn is_main_thread() -> bool {
  use objc::runtime::{Class, BOOL, NO};
  let cls = Class::get("NSThread").unwrap();
  let result: BOOL = unsafe { msg_send![cls, isMainThread] };
  result != NO
}

struct NoSyncSend {
  _marker: std::marker::PhantomData<*mut std::os::raw::c_void>,
}
